import request from "@/utils/request";  

/**
 * 注册接口
 */
export const getRegister = (data) => {
  return request({
    url: "/api/v1/user/register",
    method: "post",
    data
  });
}

/**
 * 登录接口
 */
export const getLogin = (data) => {
    console.log("登录接口调用...")
    console.log(data)
  return request({
    url: "/api/v1/user/login",
    method: "post",
    data
  });
}

/**
 * 获取用户信息的接口(通过token)
 */
export const getUserInfo = () => {
  return request({
    url: "/api/v1/user/userInfo",
    method: "get",
  });
}

/**
 * 退出登录
 */

/**
 * 课程列表查询接口
 */
export const getCourseList = (data) => {
    return request({
        url: "/api/v1/course/find",
        method: "get",
        data // data中的参数：category、page、size
    })
}

/**
 * 课程编辑的接口
 */
export const changeCourse = (data) => {
    return request({
        url: "/api/v1/course/update",
        method: "post",
        data
    })
}

/**
 * 删除课程的接口
 */
export const deleteCourse = (data) => {
    return request({
        url: "/api/v1/course/deleteCourse",
        method: "get",
        data
    })
}